diff options
| author | Adam Soltys <[email protected]> | 2023-03-16 23:04:32 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-16 23:04:36 -0700 |
| commit | cdc3a2677c8728af27084024daba288153c2bd52 (patch) | |
| tree | 06330e17d9c5efa4bb52a8b8db955d195a25972f /src/routes/(app)/[username] | |
| parent | bee2cdd4a24787c4bf808de4d03783955610c905 (diff) | |
| download | coinos-ui-cdc3a2677c8728af27084024daba288153c2bd52.tar.gz coinos-ui-cdc3a2677c8728af27084024daba288153c2bd52.zip | |
admin route
Diffstat (limited to 'src/routes/(app)/[username]')
4 files changed, 21 insertions, 8 deletions
diff --git a/src/routes/(app)/[username]/(profile)/followers/+page.svelte b/src/routes/(app)/[username]/(profile)/followers/+page.svelte index 9c425449..56b3ba16 100644 --- a/src/routes/(app)/[username]/(profile)/followers/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/followers/+page.svelte @@ -15,7 +15,9 @@ <svelte:window bind:innerWidth={w} /> <div class="px-3 md:px-0 w-full md:w-[400px] mx-auto space-y-8"> - <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold">{$t('user.followers')}</h1> + <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold"> + {$t('user.followers')} + </h1> {#if browser} {#if followers.length} diff --git a/src/routes/(app)/[username]/(profile)/follows/+page.svelte b/src/routes/(app)/[username]/(profile)/follows/+page.svelte index b6256a71..b238c3a7 100644 --- a/src/routes/(app)/[username]/(profile)/follows/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/follows/+page.svelte @@ -14,7 +14,9 @@ <svelte:window bind:innerWidth={w} /> <div class="px-3 md:px-0 w-full md:w-[400px] mx-auto space-y-8"> - <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold">{$t('user.following')}</h1> + <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold"> + {$t('user.following')} + </h1> {#if browser} {#if follows.length} diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index 4e2e6ede..c9cc5c40 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -64,7 +64,7 @@ amount_fiat: f((p.amount * p.rate) / sats, p.currency), fee_fiat: p.fee ? f((p.fee * p.rate) / sats, p.currency) : null, tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null, - total_fiat: f(((p.amount + (p.tip || 0)) * p.rate) / sats, p.currency) + total_fiat: f(((p.amount + (p.tip || 0)) * p.rate) / sats, p.currency) })); let keys = [ diff --git a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte index 06e80c8c..997d8b4a 100644 --- a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte +++ b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte @@ -5,7 +5,7 @@ import { Icon, Spinner, Pin } from '$comp'; import { t } from '$lib/translations'; - import { fail, post, success } from '$lib/utils'; + import { fail, post, warning, success } from '$lib/utils'; import { avatar, banner, password, pin } from '$lib/store'; import { upload } from '$lib/upload'; import { page } from '$app/stores'; @@ -55,7 +55,12 @@ let data = new FormData(formElement); if (data.get('password')) { - data.set('cipher', await reEncryptEntropy(user, data.get('password'))); + try { + data.set('cipher', await reEncryptEntropy(user, data.get('password'))); + } catch (e) { + console.log('Failed to encrypt keys with new password'); + throw e; + } } if ($avatar) { @@ -80,8 +85,12 @@ tags: [] }; - await sign({ event, user }); - await send(event); + try { + await sign({ event, user }); + await send(event); + } catch (e) { + warning('nostr profile could not be updated'); + } const response = await fetch(formElement.action, { method: 'POST', @@ -150,7 +159,7 @@ {#if loading} <Spinner /> {:else} - <div class="my-auto">{$t('user.settings.saveSettings')}</div> + <div class="my-auto">{$t('user.settings.saveSettings')}</div> {/if} </button> </div> |
